#include <iostream>

void swap(int *a, int *b)
{
    int temp = *a;
    *a = *b;
    *b = temp;
}
void swap_01(int &a, int &b)
{
    int temp = a;
    a = b;
    b = temp;
}
void show(const int &a)
{
    std::cout << a << std::endl;
}
int main()
{
#if 0
    int a = 10;
    /*引用定义必须初始化,不再改变朝向，不会再指向其他地方*/
    int &b = a;
    int c = 20;
    b = c;
    // swap(&a, &b);
#endif
#if 0
    int a = 10;
    int b = 20;
    swap_01(a, b);
#endif
#if 0
    char a = 'a';
    char &b = a;
     std::cout << sizeof(b) << std::endl;
#endif
    int a = 10;
    show(a);
    show(20);
    // std::cout << b << std::endl;
    return 0;
}